package com.hms.listener;

import javax.servlet.ServletContextEvent;
import javax.servlet.ServletContextListener;

import org.springframework.web.context.WebApplicationContext;
import org.springframework.web.context.support.WebApplicationContextUtils;

public class HMSApplicationContextListener implements ServletContextListener{
	 
		WebApplicationContext springContext = null;
		
		@Override
		public void contextDestroyed(ServletContextEvent arg0) {
			System.out.println("ServletContextListener destroyed");
		}
	 
		@Override
		public void contextInitialized(ServletContextEvent arg0) {
			System.out.println("ServletContextListener started");	
			springContext = WebApplicationContextUtils.getRequiredWebApplicationContext(arg0.getServletContext());
			//SomeBean someBean = (SomeBean) ctx.getBean("someBean");
			
			
		}
	}
